<?php
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php echo $html->charset(); ?>

        <title>
            <?php __('Mondo Redondo'); ?> -
            <?php echo $title_for_layout; ?>
        </title>

        <?php
        echo $html->meta('icon');

        echo $html->css(array('estilo','datePicker','menu'));

        echo $javascript->link('jquery','jquery.hoverIntent.minified','menu');

        echo $scripts_for_layout;
        ?>
        <script type="text/javascript">
          // Google Analytics
          var _gaq = _gaq || [];
          _gaq.push(['_setAccount', 'UA-17415933-1']);
          _gaq.push(['_trackPageview']);

          (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
          })();
          // Fim do Google Analytics
        </script>
    </head>
    <body>
        <div id="page-wrap">
            <div id="top-bar">
                <?php
                echo $html->link(
                $html->image('banner5.gif', array('alt'=> __("Mondo Redondo", true), 'border'=>"0")),
                '/', array(),null, false);
                /*echo $html->link('@','/', array('class'=>'site_title'));
                echo $html->link('mondo','/', array('class'=>'site_title', 'style'=>'color: #1b5790;'));
                echo $html->link('redondo','/', array('class'=>'site_title'));*/
                ?>
                <div id="right-side">
                    <?php $html->image('usericon.jpg', array('alt'=> __('user icon', true), 'border'=>"0")); ?>&ensp;
                    <?php
                    if(isset($logado) && $logado) {
                        echo $html->link($usuario_nick, array('controller'=>'mondanos', 'action'=>'edit', 'id'=>$usuario_id)).' |';
                        echo $html->link('Escrever', array('controller'=>'textos', 'action'=>'novo')).' |';
                        echo $html->link('Sair', array('controller'=>'usuarios', 'action'=>'logout')).'&nbsp;';
                    }
                    else
                        echo '<a class="first">Visitante</a> |'.$html->link('Entrar', array('controller'=>'usuarios', 'action'=>'login'));
                    //'&ensp'.$html->link('Registrar', array('controller'=>'usuarios', 'action'=>'registrar')).'&nbsp;';
                    ?>
                    <!--<form id="main-search">
                        <label for="search-field" id="search-field-label">Search</label>
                        <input type="text" tabindex="1" maxlength="255" id="search-field"/>
                        <input type="image" alt="Search" value="Search" src="<?php echo $this->webroot; ?>img/search.png" id="search-button"/>
                    </form>-->
                </div>
            </div>
	<div id="menu">
		<ul class="menu">
                    <li><a href="#"><span>Destaques</span></a></li>
                    <li <?php echo ($this->params['controller'] == 'mondanos')?'class="current"':'' ?>>
                        <a href="#"><span>Mondanos</span></a>
                        <div>
                            <ul>
                            <?php foreach($menuMondanos as $menu_mondano):?>
                                <li><?php echo $html->link($menu_mondano['Mondano']['nick'], '/'.$menu_mondano['Mondano']['slug']); ?></li>
                            <?php endforeach; ?>
                                <li><a href="#" class="parent"><span>Colaboradores</span></a>
                                <div>
                                    <ul>
                                    <?php foreach($menuColaboradores as $menu_colaborador):?>
                                        <li><?php echo $html->link($menu_colaborador['Mondano']['nick'], '/'.$menu_colaborador['Mondano']['slug']); ?></li>
                                    <?php endforeach; ?>
                                    </ul>
                                </div>
                            </li>
                            </ul>
                        </div>
                    </li>
                    <?php foreach($menuSecoes as $menu_secao):
                        $current = (($secaoAtual != '') && ($secaoAtual == $menu_secao['Secao']['slug']))?'class="current"':'';
                    ?>
                    <li <?php echo $current ?>><span><?php echo $html->link($menu_secao['Secao']['nome'], '/secoes/'.$menu_secao['Secao']['slug']); ?></span>
                        <div>
                            <ul>
                            <?php foreach($menu_secao['Categoria'] as $menu_categoria):?>
                                <li><?php echo $html->link($menu_categoria['nome'], '/categorias/'.$menu_categoria['slug']); ?></li>
                            <?php endforeach; ?>
                            </ul>
                        </div>
                    </li>
                    <?php endforeach; ?>
		</ul>
            </div>

    <div id="main-content">
        <div id="feature-content">

            <?php
            $session->flash();
            ?>

            <?php echo $content_for_layout; ?>

            <div class="clear"></div>
        </div>
    </div>

    <div id="footer">Desenvolvido por <?php echo $html->link('ACG', 'http://www.acganyware.com.br', array('target'=>'_blank')) ?>
        <div id="copyright">
            | &copy; menus por <?php echo $html->link('Apycom jQuery Menus', 'http://apycom.com/', array('target'=>'_blank')) ?></div>
    </div>

</div>
</body>
</html>